package com.xiaocg.momento.black_box;

public class BlackBoxTest {
    public static void main(String[] args) {

        GameRole role = new GameRole();
        role.initState();
        role.show();

        RoleStateCaretaker caretaker = new RoleStateCaretaker();
        caretaker.setMomento(role.save());

        System.out.println("-------参战----------");
        role.fight();
        role.show();

        System.out.println("-----恢复------");
        role.recoverState(caretaker.getMomento());

        role.show();
    }
}
